﻿//-----------------------------------------------------------------------
// <copyright file="ProcessingServiceElement.cs" company="FastNET Services">
//     Copyright (c) 2007-2009. All Rights Reserved.
// </copyright>
// <license>
//     GPLv2
// </license>
// <warranty>
//     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
//     BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
//     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
//     DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// </warranty>
//-----------------------------------------------------------------------
#region Usings
using System.Configuration;
#endregion

namespace FastNET.CleanAct.Client.Configuration.ProcessingServices
{
    /// <summary>
    /// ConfigurationElement for a processing group
    /// </summary>
    public class ProcessingGroupElement : ConfigurationElement
    {
        /// <summary>
        /// Gets or sets the name for the processing group
        /// </summary>
        [ConfigurationProperty("name", IsRequired = true, IsKey = true)]
        public string Name
        {
            get
            {
                return this["name"] as string;
            }

            set
            {
                this["name"] = value;
            }
        }

        /// <summary>
        /// Gets or sets the order for this element in the group
        /// </summary>
        [ConfigurationProperty("order", IsRequired = true, DefaultValue = 0)]
        public byte Order
        {
            get
            {
                return (byte)this["order"];
            }

            set
            {
                this["order"] = value;
            }
        }

        /// <summary>
        /// Gets or sets whether or not the group is enabled
        /// </summary>
        [ConfigurationProperty("enabled", IsRequired = false, DefaultValue = true)]
        public bool Enabled
        {
            get
            {
                return (bool)this["enabled"];
            }

            set
            {
                this["enabled"] = value;
            }
        }
    }
}
